using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace XnaDevRu.Bullet
{
	public class CollisionPairCallback : IOverlapCallback
	{
		private DispatcherInfo _dispatchInfo;
		private CollisionDispatcher _dispatcher;

		public CollisionPairCallback(DispatcherInfo dispatchInfo, CollisionDispatcher dispatcher)
		{
			_dispatchInfo = dispatchInfo;
			_dispatcher = dispatcher;
		}

		#region IOverlapCallback Members
		public bool ProcessOverlap(ref BroadphasePair pair)
		{
			_dispatcher.NearCallback(ref pair, _dispatcher, _dispatchInfo);
			return false;
		}
		#endregion
	}
}
